from pydantic import BaseModel, Field
from typing import Optional

class UserCreate(BaseModel):
    account: str = Field(..., max_length=50)
    password: str = Field(..., min_length=6)
    role: str = Field(...)

class UserOut(BaseModel):
    user_id: int
    account: str
    role: str

    class Config:
        from_attributes = True

